.MODEL small
.586
EXTRN lirent:proc, ecrent:proc
EXTRN ecrbool:proc
EXTRN ecrch:proc, ligsuiv:proc
.CODE

debut:
STARTUPCODE

enter 3,0

.DATA
mess0 db "n=? $"

.CODE
lea dx,mess0
push dx
 call ecrch

lea dx,[bp+-4]
push word ptr dx
call lirent

push word ptr 1

pop ax
mov [bp+-2],ax

push word ptr 0

pop ax
mov [bp+0],ax

ttq1:

push word ptr [bp+-2]

push word ptr [bp+-4]

pop ax
pop bx
cmp bx,ax
setle ah
setle al
push word ptr ax

pop ax
cmp ax,0 
je fait1

push word ptr [bp+0]

push word ptr [bp+-2]

pop ax
mov [bp+0],ax

push word ptr [bp+-2]

push word ptr 1

pop ax
mov [bp+-2],ax

jmp ttq1

fait1:

call ligsuiv

push word ptr [bp+0]

call ecrent

fprinc:

EXITCODE
end debut
